The Transmission Control Protocol (TCP) is a transport-layer (OSI Layer 4) protocol that provides reliable data transfer between networked devices. Indeed, TCP is perhaps the most widely used transport protocol for traffic transferred across the Internet. All of the functionality required to deliver application data in a reliable fashion, e.g., sequencing, flow control, and data corruption, is embodied within TCP. To achieve this functionality, TCP breaks up an application data stream into discrete segments or packets, and attaches a TCP header to each packet. This packet (often with the addition of a separate IP header) is then passed to lower protocol layers for delivery over the communications network.
As illustrated in FIG. 1, a TCP header 10 has numerous fields that are used to communicate a variety of information. For example, the header includes a 16-bit source port address field 12 and a 16-bit destination port addresses field 14. Also included is a 32-bit sequence number field 16, which identifies the sequence number of the first data octet in the subject packet. Sequence numbers are used to ensure that arriving packets can be ordered as the sender intended and to associate a data packet with its corresponding acknowledgement. This allows the sender to estimate the current round-trip time (RTT) across the network. Sequence numbers are selected using a special algorithm to ensure that delayed data from an old connection is not incorrectly interpreted as being valid within a current connection.
Other fields in the TCP header include the acknowledgement sequence number 18, the data offset field 20, various single-bit flags (used to indicate various conditions) 22-32, and a window filed 34. The acknowledgment sequence number 18 is used to inform the remote end of the data that has been successfully received. The URG flag 22 is used to indicate whether the urgent pointer is valid. The ACK flag 24 is used to indicate whether the acknowledgment field is valid. The PSH flag 26 is set when the sender wants the remote TCP layer to push this data to the remote application. The RST flag 28 is used to reset the connection. The SYN (synchronize) flag 30 is used during the initial connection handshake, and the FIN (finish) flag 32 is used when closing the connection. The window field 34 is an indication of the available buffer space at the receiver.
A TCP checksum 36 is applied to a complete header that includes the source and destination addresses from an IP datagram. A TCP checksum is also applied to the complete TCP data contained in a single TCP packet. The final field in the TCP header is the urgent pointer 38, which, when added to the sequence number 16, indicates the sequence number of the final octet of urgent data if the urgent flag 22 is set. Following the header is a data field 40.
In addition to the above-described mandatory fields, a TCP header 10 can include various options in a TCP options field 42. Many options can be carried in a TCP header, and a number of such options have been defined by various Requests for Comments (RFCs). RFCs are both the name of the result and the process for creating a standard relating to technologies associated with the Internet. New standards are proposed and published as RFCs and subsequently reviewed by the Internet Engineering Task Force (IETF). A list of TCP options described in various RFCs is presented in Table 1 below.
TABLE 1RFCs Related to TCP OptionsKindLengthMeaningReference 0—End of Option ListRFC 793 1—No-OperationRFC 793 24Maximum Segment SizeRFC 793 33WSOPT - Window ScaleRFC 1323 42SACK PermittedRFC 2018 5NSACKREC 2018 66Echo (obsoleted by option 8)RFC 1072 76Echo Reply (obsoleted by option 8)RFC 1072 810 TSOPT - Time Stamp OptionREC 1323 92Partial Order Connection PermittedRFC 1693103Partial Order Service ProfileRFC 169311—CCRFC 164412—CC.NEWRFC 164413—CC.ECHORFC 1644143TCP Alternate Checksum RequestRFC 114615NTCP Alternate Checksum DataRFC 114616—SkeeterKnowles17—BubbaKnowles183Trailer Checksum OptionSubramaniam&Bridges1918 MD5 Signature OptionRFC 238520—SCPS CapabilitiesScott21—Selective NegativeScottAcknowledgements22—Record BoundariesScott23—Corruption experiencedScott24—SNAPSukonnik25—Unassigned26—TCP Compression FilterBellovin278Quick-Start ResponseREC 478228-252—Unassigned253 NRFC3692-style Experiment 1RFC 4727254 NRFC3692-style Experiment 2RFC 4727